<?php

if (file_exists('../../admin/')) {
    $path = '../../admin/';
} else if (file_exists('../../')) {
    $path = '../../';
} else {
    die('could not resolve admin path');
}

require_once ($path . 'inc/common.php');

if (!isset($_SESSION)) {
    session_start();
}

require_once 'inc/common.inc.php';
require_once 'inc/functions.inc.php'; //aux functions

squareit_gsp_security();

if (isset($_GET['pid'])) {
    if (file_exists($_GET['pid'] . '.xml')) {
        unlink($_GET['pid'] . '.xml');
        echo "succcess";
    } else {
        echo "Error: Poll does not exist";
    }
} else {
    //header("Location: /admin/loadtab.php?".$ref."&item=".$ref."&upd=del-err&type=Poll ID not send in request");
}